package cn.kgc.service.impl;

import cn.kgc.dao.userRoleDao;
import cn.kgc.pojo.UserRole;
import cn.kgc.service.userRoleService;
import com.github.pagehelper.Page;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author: admin
 * @date: 2022/2/16
 * @description:
 */
@Service
public class userRoleServiceImpl implements userRoleService {

    @Resource
    private userRoleDao userroledao;

    //查询用户详细信息
    @Override
    public UserRole selRoleById(Integer id) {
        return userroledao.selRoleById(id);
    }

    //添加用户信息
    @Override
    public boolean add(UserRole userrole) {
        if(userroledao.addRole(userrole)>0){
            return true;
        }
        return false;
    }

    //删除用户信息
    @Override
    public boolean del(Integer id) {
        if(userroledao.delRole(id)>0){
            return true;
        }
        return false;
    }

    //修改用户信息
    @Override
    public boolean upd(UserRole userrole) {
        if(userroledao.updRole(userrole)>0){
            return true;
        }
        return false;
    }

    //模糊查询
    @Override
    public Page<UserRole> getList(String name, String role, String department) {
        return userroledao.getList(name,role,department);
    }
}
